package org.mbds.android.sismapp;
import android.location.Location;


public class SismappUser {
	private String firstName;
	private String lastName;
	private Location location;
	private String ipAddress;
	
	public Location getLocation() {
		return location;
	}
	public void setLocation(Location location) {
		this.location = location;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public SismappUser(String ip, String lastname, String firstname, Location loc) {
		setLastName(lastname);
		setFirstName(firstname);
		setLocation(loc);
		setIpAddress(ip);
	}
	
	public SismappUser(String ip, String lastname, String firstname, double lat, double lon) {
		setLastName(lastname);
		setFirstName(firstname);
		Location loc = new Location("SISMAPP");
		loc.setLatitude(lat);
		loc.setLongitude(lon);
		setLocation(loc);
		setIpAddress(ip);
	}
	public String getIpAddress() {
		return ipAddress;
	}
	private void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}
	@Override
	public boolean equals(Object obj) {
        if (obj == null)
            return false;
        if (obj == this)
            return true;
        if (!(obj instanceof SismappUser))
            return false;

        SismappUser another = (SismappUser) obj;		
        
        if (another.ipAddress.equals(ipAddress)) 
			return true;
		else
			return false;
	}

}
